PowerShell Script
AutomatR.DefaultActivities.PowerShell.PowerShellScript
The "PowerShell Script" activity in AutomatR allows you to execute a PowerShell script file specified by its full path. This activity provides a versatile way to incorporate custom PowerShell scripts into your automation workflows.
Properties
Name | Description |
---|---|
Input | |
Script Path | Specifies the full path of the PowerShell script file to be executed. String variables containing the path of the PowerShell script file. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "PowerShell Script" activity. This delay can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 5 seconds, enter 5. |
Output | |
Result | Outputs a collection of PSObject objects representing the result of executing the PowerShell script. This output can be used as input for subsequent activities in the workflow. Collection variables containing PSObject results. |
How to use:
- Drag and drop the "PowerShell Script" activity onto the workflow.
- Configure the properties by specifying the full path of the PowerShell script file to be executed and, optionally, set the delay.
- Execute the workflow to run the specified PowerShell script.
- The output, represented as a collection of PSObject results, can be utilized in subsequent activities within the workflow.
Example:
Consider an example where the "PowerShell Script" activity is used to execute a script that retrieves information about system processes:
PowerShell Script:
Display Name: "Get Process Information"
Path: "C:\Scripts\Get-ProcessInfo.ps1"
Result: processInformation
In this example, the activity executes the PowerShell script located at "C:\Scripts\Get-ProcessInfo.ps1". The results, represented as a collection of PSObject objects, are stored in the variable "processInformation" for further use in the workflow.